New and ported response concepts for companion NPCs#271
Merged
Blixibon merged 7 commits intoFeb 4, 2024
Merged
Conversation
…used for NPC companion speech)
…BIE (because some death types, such as serverside ragdolling, remove the zombie instantly)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates new response concepts intended for custom companion NPCs, including citizens and other NPCs descending from
CNPC_PlayerCompanion. Many of these concepts were ported from Alyx's EP1/EP2 code, but a few of them are completely new.Here's a list of concepts ported from Alyx:
TLK_ENEMY_BURNING— Spoken when the NPC's enemy is ignited.TLK_DANGER_ZOMBINE_GRENADE— Spoken when a zombine pulls out a grenade.TLK_SPOTTED_INCOMING_HEADCRAB— Spoken when an enemy headcrab is seen for the first time while it's already mid-jump.TLK_SPOTTED_HEADCRAB_LEAVING_ZOMBIE— Spoken when a headcrab is seen leaving a zombie that just died.TLK_SPOTTED_ZOMBIE_WAKEUP— Spoken when a zombie is seen emerging from a slump actbusy.Alyx is still fully capable of using these concepts.
Here's a list of completely new concepts:
TLK_TAKING_FIRE— Spoken when someone fires at me, regardless of whether I was hit. (requiresai_shot_notify_targetsto be enabled)TLK_NEW_ENEMY— Spoken when a new enemy appears. UnlikeTLK_STARTCOMBAT, this can be spoken during combat and has no delay between combat engagements. This is intended to be used when a new enemy enters an already-active arena.TLK_COMBAT_IDLE— Randomly spoken when in combat, but not currently attacking (e.g. in cover or reloading). Similar toTLK_ATTACKING, but for when in an intermittent combat state.TLK_TAKING_FIREuses a new function calledOnEnemyRangeAttackedMewhich any class descended fromCBaseCombatCharactercan use. It's triggered byCBaseEntity::FireBullets()every time it runs. NPCs triggerOnEnemyRangeAttackedMeon their current enemy. Players use a separate function calledGetProbableAimTargetto try to determine what the player is most likely aiming at.This functionality is enabled by a cvar called
ai_shot_notify_targets, which is disabled by default. This can be enabled on a mod-by-mod (or map-by-map usinggame_convar_mod) basis whenTLK_TAKING_FIREis used, or for when the function is used for some other purpose (such as custom AI).Note that this does not currently account for
func_tanks or any other bullets fired by "indirect" entities. It also does not account for non-bullet range attacks.This PR also adds support for additional enemy and
func_tankcriteria.PR Checklist
developbranch OR targets another branch with a specific goal in mind